package com.ruoyi.wetest.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wetest.mapper.WetestStressRecordMapper;
import com.ruoyi.wetest.domain.WetestStressRecord;
import com.ruoyi.wetest.service.IWetestStressRecordService;

/**
 * 压测记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-05
 */
@Service
public class WetestStressRecordServiceImpl implements IWetestStressRecordService 
{
    @Autowired
    private WetestStressRecordMapper wetestStressRecordMapper;

    /**
     * 查询压测记录
     * 
     * @param testId 压测记录主键
     * @return 压测记录
     */
    @Override
    public WetestStressRecord selectWetestStressRecordByTestId(String testId)
    {
        return wetestStressRecordMapper.selectWetestStressRecordByTestId(testId);
    }

    /**
     * 查询压测记录列表
     * 
     * @param wetestStressRecord 压测记录
     * @return 压测记录
     */
    @Override
    public List<WetestStressRecord> selectWetestStressRecordList(WetestStressRecord wetestStressRecord)
    {
        return wetestStressRecordMapper.selectWetestStressRecordList(wetestStressRecord);
    }

    /**
     * 新增压测记录
     * 
     * @param wetestStressRecord 压测记录
     * @return 结果
     */
    @Override
    public int insertWetestStressRecord(WetestStressRecord wetestStressRecord)
    {
        wetestStressRecord.setCreateTime(DateUtils.getNowDate());
        return wetestStressRecordMapper.insertWetestStressRecord(wetestStressRecord);
    }

    /**
     * 修改压测记录
     * 
     * @param wetestStressRecord 压测记录
     * @return 结果
     */
    @Override
    public int updateWetestStressRecord(WetestStressRecord wetestStressRecord)
    {
        wetestStressRecord.setUpdateTime(DateUtils.getNowDate());
        return wetestStressRecordMapper.updateWetestStressRecord(wetestStressRecord);
    }

    /**
     * 批量删除压测记录
     * 
     * @param testIds 需要删除的压测记录主键
     * @return 结果
     */
    @Override
    public int deleteWetestStressRecordByTestIds(String[] testIds)
    {
        return wetestStressRecordMapper.deleteWetestStressRecordByTestIds(testIds);
    }

    /**
     * 删除压测记录信息
     * 
     * @param testId 压测记录主键
     * @return 结果
     */
    @Override
    public int deleteWetestStressRecordByTestId(String testId)
    {
        return wetestStressRecordMapper.deleteWetestStressRecordByTestId(testId);
    }
}
